#ifndef MAILBOX_FORM_H
#define MAILBOX_FORM_H

#include <string>

#include <Qt\qwidget.h>
#include <Qt\qboxlayout.h>
#include <Qt\qlabel.h>
#include <Qt\qlineedit.h>
#include <Qt\qcombobox.h>
#include <Qt\qcolor.h>
#include <Qt\qpalette.h>
#include <Qt\qregexp.h>
#include <Qt\qcheckbox.h>

#include "MailBox.h"

class MailBoxForm : public QWidget{
	Q_OBJECT

public :
	static const std::string MAIL_CSC;
	static const std::string MAIL_GMAIL;
	static const std::string MAIL_LIVE;
	static const std::string MAIL_HOTMAIL;
	static const std::string MAIL_AOL;
	static const std::string MAIL_YAHOO_PLUS;

	static const std::string SERVER_GMAIL;
	static const std::string SERVER_LIVE;
	static const std::string SERVER_AOL;
	static const std::string SERVER_YAHOO_PLUS;
	
	static const int PORT_GMAIL;
	static const int PORT_LIVE;
	static const int PORT_AOL;
	static const int PORT_YAHOO_PLUS;

	static const std::string MAIL_TYPE_CSC;
	static const std::string MAIL_TYPE_GMAIL;
	static const std::string MAIL_TYPE_LIVE;
	static const std::string MAIL_TYPE_HOTMAIL;
	static const std::string MAIL_TYPE_AOL;
	static const std::string MAIL_TYPE_YAHOO_PLUS;

	static const int MAIL_IND_CSC;
	static const int MAIL_IND_GMAIL;
	static const int MAIL_IND_LIVE;
	static const int MAIL_IND_HOTMAIL;
	static const int MAIL_IND_AOL;
	static const int MAIL_IND_YAHOO_PLUS;

	static const int SEPARATOR_STRETCH_FACTOR;
	static const int LABEL_STRETCH_FACTOR;
	static const int FIELD_STRETCH_FACTOR;

private :
	QBoxLayout* layout;

	QLabel* mailTypeLabel;
	QLabel* mailAddrLabel;
	QLabel* replyToLabel;
	QLabel* projectNameLabel;
	//QLabel* senderNameLabel;
	//QLabel* loginLabel;
	//QLabel* passwordLabel;
	//QLabel* useDefaultMailClientLabel;

	QComboBox* mailType;
	QLineEdit* mailAddr;
	QLineEdit* replyTo;
	QLineEdit* projectName;
	//QLineEdit* senderName;
	//QLineEdit* login;
	//QLineEdit* password;
	//QCheckBox* useDefaultMailClient;

	MailBox* mailBox;

	MailBoxForm(const MailBoxForm&) {}

	bool verifyFields(void);
	void enableFields(bool enabled);
	void updateMailType(void);

public :
	MailBoxForm(MailBox* _mailBox = 0);

	virtual ~MailBoxForm(void){
		//Nothing
	}

	MailBox* getMailBox(void) const { return mailBox; }

	bool validate(void);
};

#endif //MAILBOX_FORM_H